window: unrealize renderer before destroying GDK window
authorBenjamin Otte <otte@redhat.com>
Wed, 23 Nov 2016 07:25:42 +0000 (08:25 +0100)
committerBenjamin Otte <lvs@localhost.localdomain>
Wed, 23 Nov 2016 17:47:58 +0000 (18:47 +0100)
We need to unrealize the children manually for that to happen, but so it
goes.

The order is necessary because we want the renderer to still be alive
while children are unrealizing.

gtk/gtkwindow.c

index 94720c3fc746818542b99bb4b377d0f013b4e130..89213698d086c485f1f1814abb10d313d147c3a4 100644 (file)
@@ -7186,12 +7186,16 @@ gtk_window_unrealize (GtkWidget *widget)
       popover_unrealize (popover->widget, popover, window);
     }
 
-  GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
-
-  priv->hardcoded_window = NULL;
+  gtk_container_forall (GTK_CONTAINER (widget),
+                        (GtkCallback) gtk_widget_unrealize,
+                        NULL);
 
   if (priv->renderer != NULL)
     gsk_renderer_unrealize (priv->renderer);
+
+  GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
+
+  priv->hardcoded_window = NULL;
 }
 
 static void